package org.keyyond.ms.business.service.impl;

import java.util.List;
import java.util.Map;
import org.keyyond.ms.business.dao.MsbusinessEsbFormatConfigDao;
import org.keyyond.ms.business.model.MsbusinessEsbFormatConfig;
import org.keyyond.ms.business.service.MsbusinessEsbFormatConfigService;
import org.keyyond.ms.business.util.CreateDataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MsbusinessEsbFormatConfigServiceImpl implements MsbusinessEsbFormatConfigService{

	@Autowired
	private MsbusinessEsbFormatConfigDao esbFormatConfigDao;
	
	@Override
	public String createXml(String pkmangedatainfo, Map paramMap) {
		// TODO Auto-generated method stub
		//获取xml的配置信息
		List<MsbusinessEsbFormatConfig> formatConfigs = esbFormatConfigDao.selectByPkmangedatainfo(pkmangedatainfo);
		String xml = CreateDataUtil.createXml(formatConfigs, paramMap);
		return xml;
	}

	@Override
	public String createJson(String pkmangedatainfo, Map paramMap) {
		// TODO Auto-generated method stub
		//获取json的配置信息
		List<MsbusinessEsbFormatConfig> formatConfigs = esbFormatConfigDao.selectByPkmangedatainfo(pkmangedatainfo);
		String xml = CreateDataUtil.createJson(formatConfigs, paramMap);
		return xml;
	}

}
